<section class="objectnewentry panel rounded">
	<h1>New entry for object "<?php echo $object->table; ?>"</h1>
	
	<form class="table" method="post" action="api/data/insert/<?php echo $object->id;?>">
		<div class="thead">
			<div class="th field"><?php echo lang('heading_field'); ?></div>
			<div class="th language"><?php echo lang('heading_language'); ?></div>
			<div class="th value"><?php echo lang('heading_value'); ?></div>
			<div class="clear"></div>
		</div>
		<div class="tbody">
			<?php foreach ($fields as $field) { ?> 
				<?php if ($field->type != 'i18n_string') { ?>
				<div class="row">
					<div class="td field">
						<?php echo $field->name; ?>
					</div>
					<div class="td language"></div>
	 
					<div class="td value">
						<input type="<?php echo $field->type == 'boolean' ? 'checkbox' : 'text'; ?>" name="<?php echo $field->name; ?>" class="type_<?php echo $field->type; ?>" />
					</div>
				<div class="clear"></div>
				</div>
				<?php } else { 
					foreach ($languages as $language) { ?>
						<div class="row">
							<div class="td field">
								<?php echo $field->name;?>
							</div>
							<div class="td language">
								<input type="text" name="language" value="<?php echo $language->name; ?>" readonly/>
							</div>
							
							<div class="td value">
								<textarea name="<?php echo $field->name.' '.$language->id; ?>" class="value type_i18n_string"></textarea>
							</div>
							<div class="clear"></div>
						</div>
					<?php }?>
					
				<?php }} ?>
				<div class="new">
					<input type="submit" value="insert" />
				</div>			
		</div>
	
	</form>
</section>